import base64
image_path = r'D:\workspace\idea\pro-stage3\familyDoctor-app-ui\app-ui\static\background.png'
with open(image_path, 'rb') as f:
    encoded_string = base64.b64encode(f.read())
    print(encoded_string.decode('utf-8'))